home *** CD-ROM | disk | FTP | other *** search
- Path: uu4news.netcom.com!dodge!news
- From: shyam@clipper.robadome.com (Shyam Davuburu)
- Newsgroups: comp.lang.c++
- Subject: Re: Reverting of big array ?
- Date: 27 Mar 1996 20:49:15 GMT
- Organization: Siemens Rolm Communications, Inc.
- Message-ID: <4jc9kb$1bs@dodge.eng.sc.rolm.com>
- References: <4jbock$s7j@erinews.ericsson.se>
- Reply-To: shyam@clipper.robadome.com
- NNTP-Posting-Host: atlantis.eng.sc.rolm.com
-
- Try this function:
-
- swap(buff,st,end)
- char *buff;
- int st;
- int end;
- {
- if(st != end && st < end) {
- buff[st] = buff[st]+buff[end];
- buff[end] = buff[st]-buff[end];
- buff[st] = buff[st]-buff[end];
- swap(buff,st, end);
- }
- }
- main () {
- char *buff = "ABCDEFGHIJKLMN....";
- swap(buff,0,strlen(buff)-1);
- }
-
-
-
-
-
- --
- --
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- Shyam Davuluru Siemens Rolm Communications Phone #'s: (408)249 3062 (R)
- Email - shyam@siemensrolm.com (408)492 7328 (W)
- - shind@inow.com
-
-
-